<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <!-- import CSS -->
        <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    </head>
    <body>
        <div id="app">
            <div class="demo-image">
                <div class="block" v-for="fit in fits" :key="fit">
                    <span class="demonstration">{{ fit }}</span>
                    <el-image
                            style="width: 100px; height: 100px"
                            :src="url"
                            :fit="fit"></el-image>
                </div>
                <h1>1.保证图片完整显示并且不变形</h1>
                <el-image style="width: 200px;height:200px" :src="url" fit="contain"></el-image>
                <h1>2.保证图片完整显示</h1>
                <el-image style="width: 200px;height:200px" :src="url" fit="fill"></el-image>
                <h1>3.保证图片宽高比并且占满200*200</h1>
                <el-image style="width: 200px;height:200px" :src="url" fit="cover"></el-image>
            </div>
        </div>
    </body>
    <!-- import Vue before Element -->
    <script src="../../js/vue.js"></script>
    <!-- import JavaScript -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script>
        let  v = new Vue({
            el: '#app',
            data: function() {
                return {
                    fits: ['fill', 'contain', 'cover', 'none', 'scale-down'],
                    url: "nv2.jpg"
                }
            }
        })
    </script>

</html>